public class Operator {
    public static void main(String[] args) {
        // 二元运算  +-*/%
        int a = 7;
        int b = 3;
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println((float)a/b);
        System.out.println(a%b);

        // 一元运算 ++ --
        int c = ++a;
        int d = a++;
        System.out.println(c); //8
        System.out.println(d); //8
        System.out.println(a); //9


        int x = 5;
        int y = 7;
        System.out.println((x++ + ++y + x*y));

        //逻辑运算符
         boolean q = true , p = false;
         boolean flag = !p;
         System.out.println(flag);
         // 逻辑短路
        boolean flag1 = p&&q;
        System.out.println(flag1);

        // 三目运算符        ？：
        int x1 = 2,y1 = 3;
        int f = (x1>y1)?x1:y1; //   => int f = y1
        System.out.println(f);

        // 数据类型强转
        int g = 2;
        float f2  = g;
        double f3 = 1.3;
        int h = (int)f3;
        System.out.println(f2);
        System.out.println(h);






    }
}
